<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>合生元</title>
	<script src=" https://res.wx.qq.com/open/js/jweixin-1.0.0.js?v=${fns:getConfig('drawVersion')}"></script>	  
	<!-- <script src="http://sujia.node.c2d.me/wx/api/jsapiConfig?callback=wx.config&amp;debug=true"></script> -->
	<script src="../assets/scripts/draw/jquery-1.11.2.min.js?v=${fns:getConfig('drawVersion')}"></script>	    
    <script>
        var phoneWidth = parseInt(window.screen.width);
        var phoneHeight = parseInt(window.screen.height);
        var phoneScale = phoneWidth / 640;
        var ua = navigator.userAgent;
        if (/Android (\d+\.\d+)/.test(ua)) {
            var version = parseFloat(RegExp.$1);
            if (version > 2.3) {
                document.write('<meta name="viewport" content="width=640, initial-scale= ' + phoneScale + ' ,minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
            }
            else {
                document.write('<meta name="viewport" content="width=640, initial-scale= ' + phoneScale + ' , target-densitydpi=device-dpi">');
            }
        }
        else {
            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
        }
        
   	    $(function(){
/*    	    	alert(null);
   	    	alert('${openId}'); 
     	    alert('${map.url}');   
   	    	alert(location.href.split('#')[0] == '${map.url}');  	
   	    	alert(location.href.split('#')[0]);  
   	    	alert('${map.appId}');
   	    	alert(parseInt('${map.timestamp}'));
   	    	alert('${map.nonceStr}');
   	    	alert('${map.signature}');   */
   	      	wx.config(
   	    			{
   	    			debug: false,
   	    			appId: '${map.appId}',
   	    			timestamp: parseInt('${map.timestamp}'),
   	    			nonceStr: '${map.nonceStr}',
   	    			signature: '${map.signature}',
   	    			jsApiList: [
   	    			"onMenuShareTimeline",
   	    			"onMenuShareAppMessage",
   	    			"onMenuShareQQ",
   	    			"onMenuShareWeibo",
   	    			"onMenuShareQZone",
   	    			"startRecord",
   	    			"stopRecord",
   	    			"onVoiceRecordEnd",
   	    			"playVoice",
   	    			"pauseVoice",
   	    			"stopVoice",
   	    			"onVoicePlayEnd",
   	    			"uploadVoice",
   	    			"downloadVoice",
   	    			"chooseImage",
   	    			"previewImage",
   	    			"uploadImage",
   	    			"downloadImage",
   	    			"translateVoice",
   	    			"getNetworkType",
   	    			"openLocation",
   	    			"getLocation",
   	    			"hideOptionMenu",
   	    			"showOptionMenu",
   	    			"hideMenuItems",
   	    			"showMenuItems",
   	    			"hideAllNonBaseMenuItem",
   	    			"showAllNonBaseMenuItem",
   	    			"closeWindow",
   	    			"scanQRCode",
   	    			"chooseWXPay",
   	    			"openProductSpecificView",
   	    			"addCard",
   	    			"chooseCard",
   	    			"openCard"
   	    			]
   	    			}
   	    			)  	   
   	    	
		   	   var source = '${source}';
		        
		        wx.ready(function(){
		        			        	
		        	if(source != 'share'){
		          		 wx.onMenuShareTimeline({
		        			    //title: '分享单号码:${sharecode}', // 分享标题
		       			    title: '合生元请你看《愤怒的小鸟》大电影！', // 分享标题 
		        			    link: '${url}', // 分享链接
		        			    imgUrl: 'http://springdraw.c2d.me/image/分享消息.jpg', // 分享图标
		        			    success: function () { 
		        			        // 用户确认分享后执行的回调函数
		        			    },
		        			    cancel: function () { 
		        			        // 用户取消分享后执行的回调函数
		        			    }
		        			});	  
		        		 
		        		 wx.onMenuShareAppMessage({
		        			    //title: '分享单号码:${sharecode}', // 分享标题
		        			    title: '合生元请你看《愤怒的小鸟》大电影！', // 分享标题 
		        			    desc: '我刚拿了一张电影票，赶快戳开，一起组队看电影', // 分享描述
		        			    link: '${url}', // 分享链接
		        			    imgUrl: 'http://springdraw.c2d.me/image/分享消息.jpg', // 分享图标
		        			    type: '', // 分享类型,music、video或link，不填默认为link
		        			    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
		        			    success: function () { 
		        			        // 用户确认分享后执行的回调函数
		        			    },
		        			    cancel: function () { 
		        			        // 用户取消分享后执行的回调函数
		        			    }
		        			});   	       		
		        	}else{
		        		
		        		$("#backgroundImage").attr('src','../assets/images/draw2/share1.1-bj.jpg')
		        		        		 
		        	}
		        		 
		   	    })   
   	    
   	    });
   	    
   	    $(function(){
   	    	
   	    	$('.Popup1-box').css("background",'url(../assets/images/draw2/Popup-bj2.png)');
   	    	
   	    	//是否为会员
   	    	var rank = '${rank}';
   	    			
   			//奖品名称
   			var name ='${awardName}';
   			
   			//注册链接
   			var registerUrl = '${registerUrl}';
   			
   			//修改奖品信息
   			$(".winning-name").html(name);	
   			$(".winning-name2").html(name);	    	   			
   				
   			if(rank == 'nonMember'){
   	    		
   				//提示信息
   				var tipsHtml = null;   							
   				$(".winning-name2").hide();	
   															
   	              //跳到分享页面
   			   tipsHtml = "领取有效期为1个小时";				                
   	           $('.Frame-btn').html('填写手机号领取');	
   	           $('#Frame-clear1').hide();
   	           
   				$("#description").html(tipsHtml);	
   				
   	    		
   	       	 $(".Popup1-box").show();
   	    	}
   	    	
   	    })
        
        
</script>

    <link rel="stylesheet" href="../assets/css/draw/main2.css"/>
</head>
<body>
    <div class="wrap share1-bj">
        <img id = 'backgroundImage'  src="../assets/images/draw2/share1-bj.jpg" alt="合生元" width="640" height="1070">
			<c:forEach items="${gridList}" var="grid" varStatus="status">
				<c:choose>
				   <c:when test="${grid.isExists== 0 && grid.sort== 0}">  
    					<a href="javascript:;" class="samll-bird one-bird" id='${grid.id}' ></a>
				   </c:when>
				   <c:when test="${grid.isExists== 0 && grid.sort== 1}">  
    					<a href="javascript:;" class="samll-bird two-bird"id='${grid.id}' ></a>
				   </c:when>		
				   <c:when test="${grid.isExists== 0 && grid.sort== 2}">  
    					<a href="javascript:;" class="samll-bird three-bird" id='${grid.id}' ></a>
				   </c:when>	
				   <c:when test="${grid.isExists== 0 && grid.sort== 3}" >  
    					<a href="javascript:;" class="samll-bird four-bird" id='${grid.id}' ></a>
				   </c:when>						   					   		   
				</c:choose>							 					 
			</c:forEach>		
        <span class="RedeemCode">${moviecode }</span>
        <footer></footer>
    </div>
    
    <!--中奖弹窗start-->
    <div class="Popup1-box">
        <div class="light"></div>
        <div class="xx-content">
            <i class="small-xx small-xx-left"></i>
            <span class="large-xx"></span>
            <i class="small-xx small-xx-right"></i>
        </div>
        <div class="Frame">
            <span class="winning-title"></span>
            <h2><span class="winning-name"></span></h2>
            <h3>
                <p id="description">填写领奖信息吧</p>
               <span class="winning-name2">法国机票</span>
            </h3>
            <a href="#" class="Frame-btn">填写领奖信息</a>
        </div>
        <a href="javascript:;" class="Popup-bird1"></a>
    </div>
    <!--中奖弹窗end-->
 
<!--js-->
<script src="http://wximg.qq.com/wxp/libs/wxmoment/0.0.4/wxmoment.min.js"></script>

</body>
</html>